import collections


class Solution:
    def deckRevealedIncreasing(self, deck: list) -> list:
        deck.sort()
        queue = collections.deque()
        for _ in range(len(deck)):
            if queue:
                queue.appendleft(queue.pop())
            queue.appendleft(deck.pop())
        return list(queue)
